
#include "Messages.h"
#include "CBase.h"
//#include "CArrow.h"
//#include "CWeb.h"


CSpawnMummyMessage::CSpawnMummyMessage(POINT spawn,int vel, int dist) : CBaseMessage(MSG_MUM)
{
	dat.spawnpoint = spawn;
	dat.vel = vel;
	dat.dist = dist;
}
CSpawnFallingPlatformMessage::CSpawnFallingPlatformMessage(POINT spawn) : CBaseMessage(MSG_FALLINGPLAT)
{
	this->spawn = spawn;
}

CSpawnBatMessage::CSpawnBatMessage(POINT pspawn) : CBaseMessage(MSG_BAT)
{
	spawn.x = pspawn.x;
	spawn.y = pspawn.y;
}

CSpawnSpiderMessage::CSpawnSpiderMessage(POINT pspawn, int nPaceDist, int nStartDir) : CBaseMessage(MSG_SPIDER)
{
	spawn.x = pspawn.x;
	spawn.y = pspawn.y;
	paceDist = nPaceDist;
	startDir = nStartDir;
}

CSpawnWebMessage::CSpawnWebMessage(POINT pspawn) : CBaseMessage(MSG_WEB)
{
	spawn.x = pspawn.x;
	spawn.y = pspawn.y;
}

//CDestroyWebMessage::CDestroyWebMessage(CWeb* pWeb) : CBaseMessage(MSG_DESTROYWEB)
//{
//	web = pWeb;
//	web->AddRef();
//}
//
//CDestroyWebMessage::~CDestroyWebMessage()
//{
//	web->Release();
//}

CDestroyPointMessage::CDestroyPointMessage(POINT* ppt) : CBaseMessage(MSG_DESTROYPOINT)
{
	pt = ppt;
}

CDestroyPointMessage::~CDestroyPointMessage()
{
	delete pt;
}

CSpawnPickupMessage::CSpawnPickupMessage(POINT spawn,int type) : CBaseMessage(MSG_PICKUP)
{
	this->spawn = spawn;
	this->type = type;
}

CRemovePickupMessage::CRemovePickupMessage(CPickup* pickup) : CBaseMessage(MSG_REPICK)
{
	this->pickup = pickup;
}

CSpawnRatMessage::CSpawnRatMessage(POINT pspawn, int nPaceDist, int nStartDir) : CBaseMessage(MSG_RAT)
{
	spawn.x = pspawn.x;
	spawn.y = pspawn.y;
	paceDist = nPaceDist;
	startDir = nStartDir;
}

CSpawnSnakeMessage::CSpawnSnakeMessage(int nPosX, int nPosY) : CBaseMessage(MSG_SNAKE)
{
	m_nPosX = nPosX;
	m_nPosY = nPosY;
}

CSpawnArrowMessage::CSpawnArrowMessage(POINT pspawn, int move) : CBaseMessage(MSG_ARROW)
{
	spawn.x = pspawn.x;
	spawn.y = pspawn.y;
	m_nFireDirection = move;
}

CSpawnSeekArrowMessage::CSpawnSeekArrowMessage(POINT pspawn, tVector2D arrow, float fRotation) : CBaseMessage(MSG_SEEKARROW)
{
	spawn = pspawn;
	arrowVec = arrow;
	m_fRotation = fRotation;
}

//CDestroyArrowMessage::CDestroyArrowMessage(CArrow* pArrow) : CBaseMessage(MSG_DESTROYARROW)
//{
//	m_pArrow = pArrow;
//	m_pArrow->AddRef();
//}
//
//CDestroyArrowMessage::~CDestroyArrowMessage()
//{
//	m_pArrow->Release();
//}

CSpawnTurretMessage::CSpawnTurretMessage(POINT pspawn, int fire, int numProj) : CBaseMessage(MSG_TURRET)
{
	spawn.x = pspawn.x;
	spawn.y = pspawn.y;
	FireDirection = fire;
	NumProj = numProj;
}

CSpawnSeekTurretMessage::CSpawnSeekTurretMessage(POINT pspawn) : CBaseMessage(MSG_SEEKTURRET)
{
	spawn.x = pspawn.x;
	spawn.y = pspawn.y;
}

CSpawnSpikeTrapMessage::CSpawnSpikeTrapMessage(POINT pspawn, int rotation) : CBaseMessage(MSG_SPIKETRAP)
{
	spawn = pspawn;
	nRotation = rotation;
}

CSpawnSpearTrapMessage::CSpawnSpearTrapMessage(POINT pspawn, string key, int rotation) : CBaseMessage(MSG_SPEARTRAP)
{
	spawn = pspawn;
	szEventKey = key;
	nRotation = rotation;
}

CSpawnFlameTrapMessage::CSpawnFlameTrapMessage(POINT pspawn, string key, int rotation) : CBaseMessage(MSG_FLAMETRAP)
{
	spawn = pspawn;
	szEventKey = key;
	nRotation = rotation;
}